{extend name='admin@main'}

{block name="button"}

{if auth("add")}
<!-- <button data-open='{:url("add")}' data-title="添加收文" class='layui-btn layui-btn-sm layui-btn-primary'>添加收文</button> -->

{/if}

{if auth("state")}
<button data-action='{:url("state")}' data-rule="id#{key}" data-csrf="{:systoken('state')}" data-confirm="确定要强制办结吗？" class='layui-btn layui-btn-sm layui-btn-primary'>强制办结</button>
{/if}

{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='doc/index_search'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th>
            <th class='text-left nowrap'>文件标题</th>
            <th class='text-left nowrap'>文件编号</th>
            <th class='text-left nowrap'>来文单位</th>
			
			<th class='text-left nowrap'>紧急程度</th>
            <th class='text-center nowrap'>流转状态</th>
            <!-- <th class='text-left nowrap'>收文时间</th> -->
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='list-table-sort-td'>
                <label><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.id}" class="list-sort-input"></label>
            </td>
            <td class='text-left nowrap'><a data-dbclick data-open="{:url("edit")}?id={$vo.id}" title="{$vo.title}">
			{$vo.title|msubstr=50,0,'utf-8',true|default=''}</a></td>
            <td class='text-left nowrap'>{$vo.docno|default='-'}</td>
            <td class='text-left nowrap'>{$vo.docunit|default='-'}</td>
			<td class='text-left nowrap'>{$vo.jinji|default='-'}</td>
            <td class='text-center nowrap'>
                {eq name='vo.status' value='0'}<span class="color-red">已撤回</span>{/eq}
                {eq name='vo.status' value='1'}
				
				{if $vo.flowcount ==1}
				<span class="layui-badge">正在流转</span>
				{else}
				<span class="color-green">正在流转</span>
				{/if}
				
				
				{/eq}
                {eq name='vo.status' value='2'}<span class="color-desc">已经完成</span>{/eq}
            </td>
			<!--
            <td class='text-left nowrap'>
                {$vo.create_at|format_datetime='Y-m-d'}
            </td>
			-->
            <td class='text-left nowrap'>

                {if auth("edit") && $vo['docauthor']==session('admin_user')['nickname'] && $vo['status']!=2 }
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="流转" data-open='{:url("edit")}?id={$vo.id}'>流  转</a>
                {/if}


				<!--
                {if auth("state") and $vo.status neq 0}
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('state')}">禁 用</a>
                {elseif auth("state") and $vo.status neq 1 }
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('state')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('state')}">启 用</a>
                {/if}-->

                {if auth("state") and $vo.status eq 2 and $vo.docauthor eq session('admin_user.nickname')}
                <a class="layui-btn layui-btn-sm layui-btn-danger" confirm="确定要打印吗？" href="{:url('printdoc')}?id={$vo.id}" target="new" data-value="id#{$vo.id}" data-csrf="{:systoken('state')}">打  印</a>
                {/if}

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
